﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GestorSQL.BusinessEntities;
using System.IO;
using GestorSQL.DAO;

namespace GestorSQL.BLL
{
    internal class PathGetter
    {
        #region Constantes
        public const string CURRENT = "current";
        public const string ORIGINAL = "original";
        public const string FINAL = "final";
        public const string TEMPORAL = "tmp";
        public const string EJECUCION = "ejecucion{0}";
        public const string SALIDA = "salida";

        public const string DEVPATH = @"{0}\{1}\Desarrollo\";
        public const string PRODPATH = @"{0}\{1}\Produccion\solucion{2}\";
        #endregion

        #region Metodos Publicos
        public static string QUEYDIR
        {
            get
            {
                GestorSqlDao dao = new GestorSqlDao();
                return dao.GetParameter("DirectorioQueries").ToString();
            }
        }

        public static string GetDevPath(Caso caso)
        {
            return Path.Combine(QUEYDIR, string.Format(DEVPATH, caso.UsuarioPruebas, caso.NumeroCaso));
        }

        public static string GetProdPath(Caso caso, long idSolution)
        {
            return Path.Combine(QUEYDIR, string.Format(PRODPATH, caso.UsuarioPruebas, caso.NumeroCaso, idSolution));
        }
        #endregion

    }
}
